
function randomColor () {
  return '#' + Math.random().toString(16).substr(2, 6).toUpperCase();
}

const second = [{
  label: "平台管理",
  path: '/system',
  component: 'Layout',
  icon: 'icon-pingtaiguanli',
  meta: {
    i18n: 'test',
  },
  children: [{
    label: "租户管理",
    path: '/tenant',
    component: 'views/upms/tenant/index',
    icon: 'icon-navicon-zhgl',
    meta: {
      i18n: 'logs',
    },
  },
  {
    label: "菜单管理",
    path: '/menu',
    component: 'views/upms/menu/index',
    icon: 'icon-caidanguanli',
    meta: {
      i18n: 'test',
    },
  },
  {
    label: "关于",
    path: '/about',
    component: 'views/upms/about/index',
    icon: 'icon-caidanguanli',
    meta: {
      i18n: 'test',
    },
  }
]
}
,
{
  label: "商城管理",
  path: '/mall',
  component: 'Layout',
  icon: 'icon-shouye1',
  meta: {
    i18n: 'error',
  },
  children:[{
    label: "店铺管理",
    path: '/shopInfo',
    component: 'Layout',
    icon: 'icon-dianpu',
    meta: {
      i18n: 'test',
    },
    children:[
      {
        label: "全部店铺",
        path: '/shopInfo',
        component: 'views/mall/shopinfo/index',
        icon: 'icon-dianpu',
        meta: {
          i18n: 'test',
        }
      }
    ]
  },
  {
    label: "素材库",
    path: '/material',
    component: 'views/mall/shopinfo/index',
    icon: 'icon-dianpu',
    meta: {
      i18n: 'test',
    }
  }]
}
,
{
  label: "系统管理",
  path: '/system',
  component: 'Layout',
  icon: 'icon-xitong',
  meta: {
    i18n: 'test',
  },
  children: [{
    label: "日志管理",
    path: '/logs',
    component: 'views/util/logs',
    icon: 'icon-shouye',
    meta: {
      i18n: 'logs',
    },
  },
  {
    label: "角色管理",
    path: '/role',
    component: 'views/upms/role/index',
    icon: 'icon-jiaoseguanli',
    meta: {
      i18n: 'test',
    },
  }, {
    label: "用户管理",
    path: '/user',
    component: 'views/upms/user/index',
    icon: 'icon-yonghuguanli',
    meta: {
      i18n: 'test',
    },
  }]
}]
let menu = [second];

export default [{
  url: "/user/getMenu",
  method: "get",
  response: ({ query }) => {
    return {
      data: menu[query.type || 0] || []
    }
  }
}
]